package com.sunshine.design.behavior.command;

/**
 * 命令模式
 * @author WeiHong
 * @date 2019/12/4 11:35
 */
public class CommandPatternDemo {

    public static void main(String[] args) {
        Stock abcStock = new Stock();
        BuyStock buyStockOrder = new BuyStock(abcStock);
        SellStock sellStockOrder = new SellStock(abcStock);

        Broker broker = new Broker();
        broker.takeOrder(buyStockOrder);
        broker.takeOrder(sellStockOrder);

        broker.placeOrders();
    }

}
